<template>
  <Layout class="menu-left">
    <Menu mode="horizontal" @on-select='lowerStep' :active-name="modaleshow">
      <MenuItem :name="1">基础标准管理</MenuItem>
      <MenuItem :name="2">现场标准管理</MenuItem>
      <MenuItem :name="3">班组标准管理</MenuItem>
    </Menu>
    <Row v-show="modaleshow==1">
      <auditTemplateSelcet v-on="$listeners" ref="auditTemplate1" :templateTypeCode=1></auditTemplateSelcet>
    </Row>
    <Row v-show="modaleshow==2">
      <auditTemplateSelcet v-on="$listeners" ref="auditTemplate2" :templateTypeCode=2></auditTemplateSelcet>
    </Row>
    <Row v-show="modaleshow==3">
      <auditTemplateSelcet v-on="$listeners" ref="auditTemplate3" :templateTypeCode=3></auditTemplateSelcet>
    </Row>
  </Layout>
</template>
<script>
import auditTemplateSelcet from "./auditTemplateSelcet"

export default {
  components: {
    auditTemplateSelcet
  },
  name: "AuditTemplatePreset",
  data() {
    return {
      form1: {
        hazardFactor: '',
        rikRankId: '',
      },
      modaleshow: 1,
      basicsId:'',
      sceneId:'',
    }
  },
  mounted() {

  },
  methods: {
    init(sceneId,basicsId,teamId){
      this.basicsId = basicsId;
      this.sceneId = sceneId;
      this.teamId = teamId;
      this.$refs.auditTemplate1.load(basicsId,'1');
      this.$refs.auditTemplate2.load(sceneId,'2');
      this.$refs.auditTemplate3.load(teamId,'3');
    },
    lowerStep(name) {
      this.modaleshow = name
      if (name == '1') {
        this.$refs.auditTemplate1.load(this.basicsId,'1')
      } else if (name == '2'){
        this.$refs.auditTemplate2.load(this.sceneId,'2')
      }else{
        this.$refs.auditTemplate3.load(this.teamId,'3')
      }
    },

  }
}
</script>


<style scoped>

</style>
